POV-Ray : Newsgroups : povray.general : bug with spline in function : bug with spline in function Server Time
27 Apr 2024 07:19:14 EDT (-0400)
  bug with spline in function  
From: ABX
Date: 12 Aug 2002 04:52:54
Message: <knselu81q1h2qm5s0qgcbnt1h24f2426ou@4ax.com>
I have found strange behaviour when spline was readed via function. It returns
unexpected values (one result for whole spline, this result vary from render
torender). I have checked this with standard 3.5a as well as with patched
version with spline cache turned off. Both failed. I don't know function code
yet enough so have no idea what could be wrong. It is not that it appear only
during parsing time. The same appear when function of spline is used in
isosurface.

<SDL>
  #version 3.5;

  #declare Spline=spline{linear_spline -1 0 0 1 1 0};
  #declare f_Spline=function{spline{Spline}};

  // test for values readed directly from spline
  #declare C=-1;
  #while(C<=1)
    #debug concat("Spline(",str(C,0,1),")=",str(Spline(C).x,0,-1),"\n")
    #declare C=C+.5;
  #end

  // test for values readed from spline via function
  #declare C=-1;
  #while(C<=1)
    #debug concat("f_Spline(",str(C,0,1),").x=",str(f_Spline(C).x,0,-1),"\n")
    #declare C=C+.5;
  #end
</SDL>

sample output:

Spline(-1.0)=0.000000
Spline(-0.5)=0.500000
Spline(0.0)=1.000000
Spline(0.5)=0.500000
Spline(1.0)=0.000000
f_Spline(-1.0).x=0.412644
f_Spline(-0.5).x=0.412644
f_Spline(0.0).x=0.412644
f_Spline(0.5).x=0.412644
f_Spline(1.0).x=0.412644

ABX


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.